<script>
    $('.button1').click(function () {
        swal({
            title: "你确定删除吗?",
            text: "删除后就找不回来了!",
            icon: "warning",
            buttons: true,
            dangerMode: true,
        })
            .then((willDelete) => {
                if (willDelete) {

                    va = $(this)
                    $.ajax({
                        url: $(this).attr('src'),
                        data: {
                            'p_id': $(this).val(),
                        },
                        success: function (ret) {
                            if (ret.status === 200) {
                                swal("Poof! Your imaginary file has been deleted!", {
                                    icon: "success",
                                });
                                va.parent().parent().remove()
                            } else {
                                swal("Your imaginary file is safe!");
                            }
                        }

                    })
                } else {
                    swal("Your imaginary file is safe!");
                }
            });

    })
</script>